--- title: "打酱油" created: 2025-11-28 tags: - 算法 --- # 打酱油 ## 题目 [打酱油](https://www.acwing.com/problem/content/3250/) ![[image-f1c8d0fc.png]] ## 思路分析 将n尽可能拆成50 30 一个50 +7 一个30 +4 剩余部分+/10 ## 代码实现 ```cpp #include using namespace std; #define endl '\n' int main(){ ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n;cin>>n; int ans=0; while(n/50){ ans+=7; n-=50; } while(n/30){ ans+=4; n-=30; } ans+=n/10; cout<